package com.probiz.estore.common.model.content;

import com.probiz.estore.common.model.content.base.SystemMessageTbl;

/**
 * Model class for SystemMessage. Add not database mapped fileds in this class.
 */
public class SystemMessage extends SystemMessageTbl {
	public static short MESSAGE_TYPE_ORDER_MESSAGE = (short)1;
	public static short MESSAGE_NEVER_READ = (short)1;
	public static short MESSAGE_READ = (short)0;
	
	/**
	 * MY_SYSTEM_MESSAGE_LIST 所有系统信息
	 * MY_SYSTEM_MESSAGE_STATUS_LIST 未读系统信息;
	 * @author wlt
	 *
	 */
	public static enum FilterHqlName{MY_SYSTEM_MESSAGE_LIST,MY_SYSTEM_MESSAGE_STATUS_LIST};
	
  	/**
	 * Default Empty Constructor for class SystemMessage
	 */
	public SystemMessage () {
		super();
	}
	
	/**
	 * 定义实体的业务名取值； systemMessageName
	 * 必须手工完成这个部分，否则编译不通过。
	 */
	public String getSystemMessageName () {
		if (systemMessageId == null)
	        return "";
	    else
			//返回一个指定有业务意义的属性值;
			//如：product的VO就用product.productName
	        return this.getMessageHtml();
	}
	
	/**
	 * Default Key Fields Constructor for class SystemMessage
	 */
	public SystemMessage (
		 Integer in_systemMessageId
		) {
		super (
		  in_systemMessageId
		);
	}
	
	public String getMessageTypeKey(){
		if(getMessageType() == MESSAGE_TYPE_ORDER_MESSAGE){
			return "systemMessage.member_message";
		}else{
			return "systemMessage.member_other";
		}
	}

}
